The version 4.5 supports all character set in filter files, the control characters (0-31) in particular. We can specify characters in filters by using ASCII numbers in decimal, hexadecimal or octal base. For example, "\d065" "\x41" "\o101" (or "\101") all means the same character "A".
Good Example:
"\d65B" "B\101\x43" % change "AB" to "BAC"
"\0" "" % strip NULL
Hexadecimal string:
This version supports hexadecimal string in filters. The hex-string must be enclosed by dollar-sign($hex-string$). You can use one of the follow lines to convert "AB" to "BAC":
Good Example:
"AB" "BAC" % change "AB" to "BAC"
$6566$ $666567$ % change "AB" to "BAC"
$6566$ "BAC" % change "AB" to "BAC"
"AB" $666567$ % change "AB" to "BAC"
Regular expression (pattern):
This version supports Unix regular expression (pattern) for searching string. The pattern must be enclosed by single quotation marks ('pattern'). In PRExpression, we can only use pattern for first-string but not for the second-string. Here is a small description of pattern supported by PowerReplace:
Uppercase and lowercase are always ignored. An ordinary character (not mentioned below) matches that character.
^ matches beginning of line
$ matches end of line
\ quotes character after it, whether special or not
. mathches any character
* a single character followed by * matches
zero or more occurrences of the character.
In particular, ".*" matches an arbitrary possibly empty string.
+ a single character followed by + matches
one or more occurrences of the character.
[ ] a set of characters in the set matches any single character in the set.
[c1-c2] matches any character of ascii ranging from c1 to c2.
[^set] matches any character not in set.
See also any Unix book for more information about pattern.
Good Example:
'^ +' "" % strip spaces at beginning of line.
Extension of PRExpression format:
The PRExpression format has been extended to be able to support hex-string and pattern as mentioned above. Any way, the old format (version number<4.5) is 100% compatible with this extension. Here is the syntax for the new PRExpression format:
PRExpression:
"first-string" "second-string"\r or
$hex-string$ "second-string"\r or
"first-string" $second-string$\r or
$hex-string1$ $hex-string2$" \r or
'pattern' "second-string"\r or
'pattern' $second-string$\r
Bad Example:
'^ +' 'abc' % pattern at the second position
$A9876$ "" % bad hex-string, length odd
"a*b*c" "\xB3" % two * in the first-string, try "a*b\*c" "\xB3"
'[aeiou' " " % pattern syntax error
"a"a" "AA" % syntax error. try "a\"a" "AA"
"\da" "a" % decimal number error
$23" "98" % syntax error. try $23$ "98"
$A567BDG$ "98" % bad hex-string
"toto" "t*t" % bad second-string, try "toto" "t\*t"
“Char Convert Only” is now automatic:
There is no “Char Convert Only” option in the “Make PowerReplace Filter File” window, which appeared in old versions. Now this option is automaticaly set by PowerReplace if possible. See alse FAQ [Q10].
Some changes for Filter Folder:
- Scans all filter files in the “Filter” folder, even those that lie in the sub-folders.
- If there is too many filter files, you can mask someone of them by labelling (coloring) under Finder. PowerReplace scans only the folder and filter file without label(color).
- Added filter files writen by the users of PowerReplace in the sub-folder “Collection”.
- See also “FilterFile Doc” file for new filter files in the “Filter” folder.
Menu:
The name of the current filter file will appear on the menu bar after the menu “Filter”.
Application size:
This version minimizes the application size by removing some codes.
Fixed the “End” bug:
A line starting with the percent-sign(%) is a comment. In particular, the line